//
//  OosDao.h
//  Oos4ios
//
//  Created by Pablo Gonzalez on 3/9/11.
//

#import <Foundation/Foundation.h>
#import "OosDaoTicket.h"
#import "IOosDaoCallback.h"
#import "../Options/OosOptionsStore.h"
#import "../Parsers/IOosFeedParser.h"
#import "../Parsers/IOosCategoryParser.h"
#import "../Parsers/IOosEntryParser.h"
//#import "OosAtomServiceCallback.h"

@class OosAtomServiceCallback;
@class OosQuery;
@class OosAtomService;

@interface ReadAllCallback : NSObject <IOosDaoReadCallback, IOosDaoSizeCallback> {
    
    SEL sizeSelector;
    SEL readSelector;
    id delegate;
    id<IOosDaoReadCallback> readCallback;
}

@property (nonatomic) SEL sizeSelector; 
@property (nonatomic) SEL readSelector;
@property (nonatomic, retain) id delegate;
@property (nonatomic, retain) id<IOosDaoReadCallback> readCallback;

@end


@interface OosDao : NSObject {
    
    OosAtomServiceCallback *atomReadCallback;
    OosOptionsStore *options;
    OosAtomService *mAtomService;
    
    ReadAllCallback *readAllCallback;
}

/**
 Creates a new object in the remote service
 */
- (OosDaoTicket *) create: (OosObject *) object 
			 withCallback: (id<IOosDaoCreateCallback>) callback;

/**
 Read objects provided the options in the opntions store
 */
- (OosDaoTicket *) read: (id<IOosDaoReadCallback>) callback;

- (OosDaoTicket *) readAll: (id<IOosDaoReadCallback>) callback;
/**
 Updates an already existent object
 */
- (OosDaoTicket *) update: (OosObject *) object 
			 withCallback: (id<IOosDaoUpdateCallback>) callback;

- (OosDaoTicket *) deleteObject: (OosObject *) object 
				   withCallback: (id<IOosDaoDeleteCallback>) callback;

@property (nonatomic, retain, readonly) OosOptionsStore *options;

@property (nonatomic, retain, readonly) OosQuery *query;

@property (nonatomic, retain, readonly) OosAtomService *atomService;

@property (nonatomic, retain, readonly) id<IOosFeedParser> feedParser;

@property (nonatomic, retain, readonly) id<IOosCategoryParser> categoryParser;

@property (nonatomic, retain, readonly) id<IOosEntryParser> entryParser;

- (void) initAtomService: (OosAtomService *) atomService;

@end
